------------------------------------------------------------------------------------------------------------------------------------
      name:  plog_839
       log:  /accounts/projects/jr_ra/GRscarring/erratum/programs/analysis/extrapolate.log
  log type:  text
 opened on:  27 Nov 2024, 17:51:48

. // Program to extrapolate regressions estimated on a subset of the data to what they
. // imply for other parts. Specifically, I fit various forms of age-time-cohort regressions
. // in "runatc.do" that use only data from the 1954-1978 birth cohorts. Using the age and 
. // time coefficients (and other auxiliary coefficients, such as unemployment rate*age
. // interactions) from these regressions, what are the implied cohort effects for later cohorts?
. 
. // Jesse Rothstein
. // 9/11/2017
. 
. // Modified 9/13/17, JR: Add code for new model m0.
. //  4/16/18, JR: Adjusted march variable list. Needs to be adjusted again once march read file is fixed.
. //  4/30/18, JR: Edited to conform to new runatc.
. //  5/22/18, RY: Added new topcoded annual earnings variable (to be used for main analysis)  
. //  6/1/18, JR:  Adjusted to handle new "c" models from runatc.
. //  8/16/18, JR: Adjusted to handle new "d" models from runatc.
. //  9/11/19, NG: Adjusted to handle the new cohort definition (lines 209 & 219)
. // NG 01/20/2020: Edit, new name for the cohort variable (entrycohort) and new variable for the birth year (birthcohort)
. 
. // NOTES:
. //  Need to adjust threshold for zero mean residuals once the variables have been 
. //  normalized to a reasonable scale.
. 
. 
. clear

. cap project, doinfo

. if _rc==0 {
.         local pdir "`r(pdir)'"                                                      // the project's main dir.
.         local dofile "`r(dofile)'"                                                  // do-file's stub name
.         local sig {bind:{hi:[`dofile'.dta. RP : `dofile'.do, `c(current_date)']}}       // a signature in notes
.         local doasproject=1
. }

. else {
.         local pdir "~/GRscarring"
.         local dofile "extrapolate"
.         local doasproject=0
. }

. 
. set more off

. local rootdir "`pdir'"

. local thisdir "`pdir'"

. 
. local prepdata "`pdir'/scratch"

. local rawdata "`pdir'/rawdata"

. local output "`pdir'/scratch"

. 
. /* 
> local depvarscps "empl unem labfor married hourslw hourslw_pos uhours livewithprnt chld_pr educ_occup lives_spouse_oth"
> //local depvarsmar "employed_ly ann_inc ann_ern ann_inc_pos ann_ern_pos log_ann_ern log_ann_inc wkswork wkswork_pos hrswk_ly hrswk
> _ly_pos"
> //local depvarsmar "pearnval_r pearnval_r_tc lpearnval_r lpearnval_r_tc posearn"
> local depvarsmar "earn_r_pos earn_r_pos_tc log_earn_r_pos log_earn_r_pos_tc inc_r_pos inc_r_pos_tc log_inc_r_pos log_inc_r_pos_tc 
> wkswork wkswork_pos"
> local depvarsorg "paidhre w_nber w_no_no uhourse wage_jr rw rw_l rw_nber wage_occup log_wk_ern"
> */
. local depvarscps "empl"

. local depvarsmar "log_pearnval_tc_r"

. local depvarsorg "rw_l"

. 
. local modellist "A B C D E F"

. local educlist "0 1"

. local sufflist "a b c"

. 
. if `doasproject'==1 {
.         project, uses("`prepdata'/runatc_fitted.dta")
project GRscar_erratum > do-file uses: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/runatc_fitted.dta" filesig(1992836334:2
> 57434096)
.         project, uses("`prepdata'/runatc_coeffs.dta")
project GRscar_erratum > do-file uses: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/runatc_coeffs.dta" filesig(1418047973:1
> 958395)
. }

. 
. use `prepdata'/runatc_fitted, clear // These data are year-entrycohort-state

. 
. // Get a list of variables, by looking at all of the form mA0_*_xb
. foreach v of varlist mA0a_*_xb {
  2.   local l=strlen("`v'")
  3.   local vstub=substr("`v'", 6, `l'-8)
  4.   di "`v' turns to `vstub'"
  5.   local dvlist "`dvlist' `vstub'"
  6. }
mA0a_empl_xb turns to empl
mA0a_log_pearnval_tc_r_xb turns to log_pearnval_tc_r
mA0a_rw_l_xb turns to rw_l

.  
. // Check which weight to use 
. foreach v of local dvlist {
  2.    // Assign weights to variables
.     foreach w of local depvarscps {
  3.       if "`v'"=="`w'" local w_`v'="bigcpswgt"
  4.     }
  5.     foreach w of local depvarsmar {
  6.       if "`v'"=="`w'" local w_`v'="marchwgt"
  7.     }
  8.     foreach w of local depvarsorg {
  9.       if "`v'"=="`w'" local w_`v'="orgwgt"
 10.     }
 11.   if "`w_`v''"=="" {
 12.     local w_`v'="UNDEFINED"
 13.     di "Variable `v' has undefined weight -- error."
 14.     err
 15.   }  
 16.   di "For variable `v', weight is `w_`v''"
 17. } 
For variable empl, weight is bigcpswgt
For variable log_pearnval_tc_r, weight is marchwgt
For variable rw_l, weight is orgwgt

. keep bigcpswgt marchwgt orgwgt entrycohort estsamp educ2 m*xb m*samp `dvlist' 

. 
. // Make residuals
. foreach v of local dvlist {
  2.   foreach m of local modellist {
  3.     foreach e of local educlist {
  4.       foreach sufflet of local sufflist { // Note that the "b" models use all data so this is just a check.k
  5.         if "`sufflet'"~="d" | inlist("`m'","C","D","E") {
  6.           gen double m`m'`e'`sufflet'_`v'_resid=`v'-m`m'`e'`sufflet'_`v'_xb if educ2==`e'
  7.           if "`w_`v''"=="bigcpswgt" {
  8.             rename m`m'`e'`sufflet'_`v'_resid cps_m`m'`e'`sufflet'_`v'_resid
  9.             rename m`m'`e'`sufflet'_`v'_samp cps_m`m'`e'`sufflet'_`v'_samp
 10.           }
 11.           if "`w_`v''"=="marchwgt" {
 12.             rename m`m'`e'`sufflet'_`v'_resid mar_m`m'`e'`sufflet'_`v'_resid
 13.             rename m`m'`e'`sufflet'_`v'_samp mar_m`m'`e'`sufflet'_`v'_samp
 14.           }
 15.           else if "`w_`v''"=="orgwgt" {
 16.             rename m`m'`e'`sufflet'_`v'_resid org_m`m'`e'`sufflet'_`v'_resid
 17.             rename m`m'`e'`sufflet'_`v'_samp org_m`m'`e'`sufflet'_`v'_samp
 18.           }
 19.         }
 20.       }
 21.     }
 22.   }
 23. }  
(45,910 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(50,229 missing values generated)
(50,229 missing values generated)
(50,229 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(50,229 missing values generated)
(50,229 missing values generated)
(50,229 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(50,229 missing values generated)
(50,229 missing values generated)
(50,229 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(52,524 missing values generated)
(52,524 missing values generated)
(52,524 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(52,524 missing values generated)
(52,524 missing values generated)
(52,524 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(52,524 missing values generated)
(52,524 missing values generated)
(52,524 missing values generated)
(48,133 missing values generated)
(48,133 missing values generated)
(48,133 missing values generated)
(52,340 missing values generated)
(52,340 missing values generated)
(52,340 missing values generated)
(48,133 missing values generated)
(48,133 missing values generated)
(48,133 missing values generated)
(52,340 missing values generated)
(52,340 missing values generated)
(52,340 missing values generated)
(48,133 missing values generated)
(48,133 missing values generated)
(48,133 missing values generated)
(52,340 missing values generated)
(52,340 missing values generated)
(52,340 missing values generated)
(52,774 missing values generated)
(52,774 missing values generated)
(52,774 missing values generated)
(54,627 missing values generated)
(54,627 missing values generated)
(54,627 missing values generated)
(52,774 missing values generated)
(52,774 missing values generated)
(52,774 missing values generated)
(54,627 missing values generated)
(54,627 missing values generated)
(54,627 missing values generated)
(52,774 missing values generated)
(52,774 missing values generated)
(52,774 missing values generated)
(54,627 missing values generated)
(54,627 missing values generated)
(54,627 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(50,263 missing values generated)
(50,263 missing values generated)
(50,263 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(50,263 missing values generated)
(50,263 missing values generated)
(50,263 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(45,910 missing values generated)
(50,263 missing values generated)
(50,263 missing values generated)
(50,263 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(52,557 missing values generated)
(52,557 missing values generated)
(52,557 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(52,557 missing values generated)
(52,557 missing values generated)
(52,557 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(50,551 missing values generated)
(52,557 missing values generated)
(52,557 missing values generated)
(52,557 missing values generated)

. tempfile tocollapse extrapcps extrapmar extraporg

. save `tocollapse'
file /tmp/St2868349.000004 saved as .dta format

. 
. //Make cohort-level means
. collapse (mean) cps_m*_*_resid (max) cps_m*_*_samp [aw=bigcpswgt], by(entrycohort)

. gen keep=0

. foreach m of local modellist {
  2.   foreach e of local educlist {
  3.     foreach s of local sufflist {
  4.       if "`s'"~="d" | inlist("`m'","C","D","E") {
  5.         foreach v of local depvarscps {
  6.           assert inlist(cps_m`m'`e'`s'_`v'_samp, 0, 1)
  7.           cap assert abs(cps_m`m'`e'`s'_`v'_resid)<1e-9 if cps_m`m'`e'`s'_`v'_samp==1
  8.           if _rc~=0 & "`s'"!="c" {
  9.             di "Error: Got non-zero residuals in sample for variable `v'"
 10.             di "Model `m', educ `e', suffix `s'"
 11.             error
 12.           }
 13.           qui replace cps_m`m'`e'`s'_`v'_resid=. if cps_m`m'`e'`s'_`v'_samp==1
 14.           qui replace keep=1 if cps_m`m'`e'`s'_`v'_samp==0 
 15.         }
 16.       }
 17.     }
 18.   }
 19. }

. keep if keep==1
(31 observations deleted)

. drop keep

. drop *_samp

. rename cps_m*_resid m*

. save `extrapcps'
file /tmp/St2868349.000005 saved as .dta format

. 
. use `tocollapse', clear

. collapse (mean) mar_m*_*_resid (max) mar_m*_*_samp [aw=marchwgt], by(entrycohort)

. gen keep=0

. foreach m of local modellist {
  2.   foreach e of local educlist {
  3.     foreach s of local sufflist {
  4.       if "`s'"~="d" | inlist("`m'","C","D","E") {
  5.         foreach v of local depvarsmar {
  6.           assert inlist(mar_m`m'`e'`s'_`v'_samp, 0, 1)
  7.           cap assert abs(mar_m`m'`e'`s'_`v'_resid)<1e-9 if mar_m`m'`e'`s'_`v'_samp==1
  8.           if _rc~=0 & "`s'"~="c" {
  9.             di "Error: Got non-zero residuals in sample for variable `v', with m/e/s=`m'/`e'/`s'"
 10.             error
 11.           }
 12.           qui replace mar_m`m'`e'`s'_`v'_resid=. if mar_m`m'`e'`s'_`v'_samp==1
 13.           qui replace keep=1 if mar_m`m'`e'`s'_`v'_samp==0 
 14.         }
 15.       }
 16.     }
 17.   }
 18. }

. keep if keep==1
(31 observations deleted)

. drop keep

. drop *_samp

. rename mar_m*_resid m*

. save `extrapmar'
file /tmp/St2868349.000006 saved as .dta format

. 
. use `tocollapse', clear

. collapse (mean) org_m*_*_resid (max) org_m*_*_samp [aw=orgwgt], by(entrycohort )

. gen keep=0

. foreach m of local modellist {
  2.   foreach e of local educlist {
  3.     foreach s of local sufflist {
  4.       if "`s'"~="d" | inlist("`m'","C","D","E") {
  5.         foreach v of local depvarsorg {
  6.           assert inlist(org_m`m'`e'`s'_`v'_samp, 0, 1)
  7.           cap assert abs(org_m`m'`e'`s'_`v'_resid)<1e-9 if org_m`m'`e'`s'_`v'_samp==1
  8.           if _rc~=0 & "`s'"~="c" {
  9.             di "Error: Got non-zero residuals in sample for variable `v', with m/e/s=`m'/`e'/`s'"
 10.             error
 11.           }
 12.           qui replace org_m`m'`e'`s'_`v'_resid=. if org_m`m'`e'`s'_`v'_samp==1
 13.           qui replace keep=1 if org_m`m'`e'`s'_`v'_samp==0 
 14.         }
 15.       }
 16.     }
 17.   }
 18. }

.    
. keep if keep==1
(31 observations deleted)

. drop keep

. drop *_samp

. rename org_m*_resid m*

. save `extraporg'
file /tmp/St2868349.000007 saved as .dta format

. 
. use `extrapcps'

. merge 1:1 entrycohort using `extrapmar', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             3
        from master                         2  
        from using                          1  

    Matched                                30  
    -----------------------------------------

. merge 1:1 entrycohort using `extraporg', nogen

    Result                      Number of obs
    -----------------------------------------
    Not matched                             1
        from master                         1  
        from using                          0  

    Matched                                32  
    -----------------------------------------

. 
. // NG,  9/19: update to adapt to the newt cohort definition
. * Non-college was originally the 1952 birth cohort. Add 18 -> 1970
. foreach v of varlist m?0b* { // check that these "extra" cohort effects are zero.
  2.   cap assert abs(`v')<1e-9  if `v'<. & entrycohort>=1970 /*& year!=2019*/
  3.   if _rc~=0 {
  4.     di "Error: Got non-zero residuals for variable `v'"
  5.     error
  6.   }
  7. }   

. 
. // NG,  9/19: update to adapt to the newt cohort definition
. //  College was originally the 1948 birth cohort. Add 22 -> 1970
. foreach v of varlist m?1b* { // check that these "extra" cohort effects are zero.
  2.   cap assert abs(`v')<1e-9  if `v'<. & entrycohort>=1970 /*& year!=2019 & cohort<=1995 */
  3.   if _rc~=0 {
  4.     di "Error: Got non-zero residuals for variable `v'"
  5.     error
  6.   }
  7. }   

. tempfile extrap

. save `extrap'
file /tmp/St2868349.000008 saved as .dta format

. 
. //Clean up these data to augment runatc_coeffs
.  local first=1

.  tempfile extrapcoeffs

.  foreach v in `dvlist' {
  2.    foreach m of local modellist { // Note that the "b" models use all data so no need to bother.
  3.      foreach e of local educlist {
  4.        use entrycohort m`m'`e'a_`v' using `extrap', clear
  5.        keep if m`m'`e'a_`v'<.
  6.        gen model="m`m'`e'a"
  7.        gen depvar="`v'"
  8.        gen ivartype="FV"
  9.        gen fvname="entrycohort"
 10.        rename m`m'`e'a_`v' b
 11.        rename entrycohort fvval
 12.        gen ivartxt=string(fvval)+"e.`v'"
 13.        gen extrapolate=1
 14.        tempfile coeffs_`m'`e'_`v'
 15.        save `coeffs_`m'`e'_`v''
 16.      
.        if `first'==1 save `extrapcoeffs'
 17.        else {
 18.          append using `extrapcoeffs'
 19.          save `extrapcoeffs', replace
 20.        }
 21.        local first=0
 22.      }
 23.    }
 24.  }
(1 observation deleted)
file /tmp/St2868349.00000a saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(5 observations deleted)
file /tmp/St2868349.00000b saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(1 observation deleted)
file /tmp/St2868349.00000c saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(5 observations deleted)
file /tmp/St2868349.00000d saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(1 observation deleted)
file /tmp/St2868349.00000e saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(5 observations deleted)
file /tmp/St2868349.00000f saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00000g saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00000h saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00000i saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00000j saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00000k saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00000l saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(3 observations deleted)
file /tmp/St2868349.00000m saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(7 observations deleted)
file /tmp/St2868349.00000n saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(3 observations deleted)
file /tmp/St2868349.00000o saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(7 observations deleted)
file /tmp/St2868349.00000p saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(3 observations deleted)
file /tmp/St2868349.00000q saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(7 observations deleted)
file /tmp/St2868349.00000r saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(16 observations deleted)
file /tmp/St2868349.00000s saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(16 observations deleted)
file /tmp/St2868349.00000t saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(16 observations deleted)
file /tmp/St2868349.00000u saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(16 observations deleted)
file /tmp/St2868349.00000v saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(16 observations deleted)
file /tmp/St2868349.00000w saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(16 observations deleted)
file /tmp/St2868349.00000x saved as .dta format
file /tmp/St2868349.000009 saved as .dta format
(1 observation deleted)
file /tmp/St2868349.000010 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(5 observations deleted)
file /tmp/St2868349.000011 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(1 observation deleted)
file /tmp/St2868349.000012 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(5 observations deleted)
file /tmp/St2868349.000013 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(1 observation deleted)
file /tmp/St2868349.000014 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(5 observations deleted)
file /tmp/St2868349.000015 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.000016 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.000017 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.000018 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.000019 saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00001a saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format
(14 observations deleted)
file /tmp/St2868349.00001b saved as .dta format
(variable depvar was str4, now str17 to accommodate using data's values)
(variable ivartxt was str10, now str23 to accommodate using data's values)
file /tmp/St2868349.000009 saved as .dta format

. use `prepdata'/runatc_coeffs

. gen extrapolate=0

. replace model=model+"a" if length(model)==3
(0 real changes made)

. append using `extrapcoeffs'
(variable b was float, now double to accommodate using data's values)
(variable ivartxt was str18, now str23 to accommodate using data's values)

. duplicates report model depvar ivartype cvname fvname fvval

Duplicates in terms of model depvar ivartype cvname fvname fvval

--------------------------------------
   Copies | Observations       Surplus
----------+---------------------------
        1 |        21618             0
--------------------------------------

. assert r(N)==r(unique_value)

. save `output'/extrapolate_coeffs, replace
(file /accounts/projects/jr_ra/GRscarring/erratum/scratch/extrapolate_coeffs.dta not found)
file /accounts/projects/jr_ra/GRscarring/erratum/scratch/extrapolate_coeffs.dta saved

. 
. // Now lets go back to the fitted data and fix those as well.
. use `prepdata'/runatc_fitted

. *rename m??_* m??a_*
. tempfile runatc

. save `runatc'
file /tmp/St2868349.00001c saved as .dta format

. 
. use `extrap'

. drop m??b_*

. rename m* m*_cohfx

. merge 1:m entrycohort using `runatc'

    Result                      Number of obs
    -----------------------------------------
    Not matched                        62,424
        from master                         0  (_merge==1)
        from using                     62,424  (_merge==2)

    Matched                            27,534  (_merge==3)
    -----------------------------------------

. assert estsamp==1 if _merge==2

. drop _merge

. foreach v in `dvlist' {
  2.   foreach m of local modellist {
  3.     foreach e of local educlist {
  4.       gen m`m'`e'a_`v'_xb_extrap=m`m'`e'a_`v'_xb
  5.       replace m`m'`e'a_`v'_xb_extrap=m`m'`e'a_`v'_xb_extrap+m`m'`e'a_`v'_cohfx if m`m'`e'a_`v'_cohfx<.
  6.       drop m`m'`e'a_`v'_cohfx
  7.     }
  8.   }  
  9. }     
(6,181 missing values generated)
(24,761 real changes made)
(6,181 missing values generated)
(24,251 real changes made)
(6,181 missing values generated)
(24,761 real changes made)
(6,181 missing values generated)
(24,251 real changes made)
(6,181 missing values generated)
(24,761 real changes made)
(6,181 missing values generated)
(24,251 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(6,181 missing values generated)
(24,533 real changes made)
(6,181 missing values generated)
(24,023 real changes made)
(6,181 missing values generated)
(24,533 real changes made)
(6,181 missing values generated)
(24,023 real changes made)
(6,181 missing values generated)
(24,533 real changes made)
(6,181 missing values generated)
(24,023 real changes made)
(13,117 missing values generated)
(17,597 real changes made)
(13,117 missing values generated)
(17,597 real changes made)
(13,117 missing values generated)
(17,597 real changes made)
(13,117 missing values generated)
(17,597 real changes made)
(13,117 missing values generated)
(17,597 real changes made)
(13,117 missing values generated)
(17,597 real changes made)
(6,181 missing values generated)
(24,761 real changes made)
(6,181 missing values generated)
(24,251 real changes made)
(6,181 missing values generated)
(24,761 real changes made)
(6,181 missing values generated)
(24,251 real changes made)
(6,181 missing values generated)
(24,761 real changes made)
(6,181 missing values generated)
(24,251 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)
(13,117 missing values generated)
(17,825 real changes made)

. isid entrycohort year fipsst age educ2

. save `output'/extrapolate_fitted, replace
(file /accounts/projects/jr_ra/GRscarring/erratum/scratch/extrapolate_fitted.dta not found)
file /accounts/projects/jr_ra/GRscarring/erratum/scratch/extrapolate_fitted.dta saved

. 
. 
. if `doasproject'==1 {
.         project, creates(`output'/extrapolate_coeffs.dta)
project GRscar_erratum > do-file creates: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/extrapolate_coeffs.dta" filesig(3506
> 80325:2415967)
.         project, creates(`output'/extrapolate_fitted.dta)
project GRscar_erratum > do-file creates: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/extrapolate_fitted.dta" filesig(4084
> 180620:309295984)
. }

. 
. 
. 
. 
. 
end of do-file
      name:  plog_839
       log:  /accounts/projects/jr_ra/GRscarring/erratum/programs/analysis/extrapolate.log
  log type:  text
 closed on:  27 Nov 2024, 17:52:01
------------------------------------------------------------------------------------------------------------------------------------
